home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
TPUG - Toronto PET Users Group
/
TPUG Users Group CD
/
TPUG Users Group CD.iso
/
AMIGA
/
AMICUS
/
AMICUS09.ADF
/
Text
/
BasicFunctionKeys
< prev
next >
Wrap
Text File
|
1986-05-22
|
1KB
|
45 lines
In order to detect a FUNCTION KEY press in AMIGA (MicroSoft) BASIC,
you must use a standard character input command such as INPUT, INPUT$,
INKEY$, etc.
The FUNCTION KEYS return an ASCII code just as any other key does. The codes
are:
Function Key ASCII Code
------------ ----------
1 129
2 130
3 131
. .
. .
10 138
Just convert the input to ASCII using the ASC function and compare it to
the above codes.
Here is some example code:
CLRSCN: 'This clears the screen
PRINT CHR$(12)
GETAKEY: 'This waits for a key to
a$ = INKEY$ 'be pressed
IF a$ = "" THEN GETAKEY
IF ASC(a$) > 128 AND ASC(a$) < 139 THEN 'This checks if the key
'was a FUNCTION key
PRINT "You have pressed Function Key";(ASC(a$) - 128)
ELSE
PRINT "That is not a Function Key..." 'This prints the answer
END IF
FOR X = 1 TO 3000:NEXT 'Short timer
GOTO CLRSCN 'Start over